<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>LAMP圣才-列表页</title>

</head>
<link rel="stylesheet" href="../public/home/css/list.css">
<body>
<!--顶部条-->
<?php require "./foot/header.php"; ?>
<!--大盒子-->
<div id="big">
    <!--顶部搜索条-->
    <div id="search">
        <form action="./public/indexaction.php" method="post">
            <input type="text" placeholder="让学习成为一种习惯!" name="name" value="">
            <select name="module">
                <option value="1">帖子</option>
                <option value="2">日志</option>
                <option value="3">用户</option>
                <option value="4">板块</option>
            </select>
            <input type="submit" value="搜索"/>
        </form>
        <ul id="hot">
            <li>热搜：</li>
            <li class="red">php</li>
            <li class="red">php视频</li>
            <li class="red">php教程</li>
        </ul>
        <div id="guanzhu">
            <ul>
                <li><a href="#"><img src="../public/home/img/sina_n.png" title="关注新浪微博"/></a></li>
                <li><a href="#"><img src="../public/home/img/qq_n.png" title="添加到QQ"/></a></li>
                <li><a href="#"><img src="../public/home/img/6.gif" title="添加笔记"/></a></li>
                <li><a href="#"><img src="../public/home/img/21.gif" title="百度浏览"/></a></li>
                <li><a href="#"><img src="../public/home/img/medal.png" title="排行榜"/></a></li>
            </ul>
        </div>
    </div>
    <!--顶部搜索条结束-->
    <?php

    $id = $_GET['id'];//这是类的id
    //				var_dump($id);

    $link = mysqli_connect("localhost", "root", "") or die("数据连接失败");
    mysqli_set_charset($link, "utf8");
    mysqli_select_db($link, "bbs");
    $sql = "select * from  type where id={$id}";
    $res = mysqli_query($link, $sql);
    if ($res && mysqli_num_rows($res) > 0) {
    while ($rows = mysqli_fetch_assoc($res)) {
    $path = "./../public/home/img/";
    $path = rtrim($path, '/') . '/';
    //					$npath = $rows['npath'];
    ?>
    <!--引导层开始-->
    <div id="yindao">
        <p><a href="#">LAMP圣才</a> > <a href="#"><?php echo $rows['name']; ?></a></p>
    </div>
<!--引导层结束-->

<!--列表开始-->
    <div id="list">
        <div id="listbt">
            <div id="bkname">
                <h4><?php echo $rows['name']; ?></h4>
            </div>
            <div id="bzname">
                <h4>版主:立强</h4>
            </div>
        </div>
        <div id="bkinfo">
            <div id="bklogo">
                <img src="<?php echo $path . $rows['blogo']; ?>">
            </div>
            <div id="tjinfo">
                <ul>
                    <li>今日:<span>3</span> |</li>
                    <li>主题:<span>10736</span> |</li>
                    <li>贴数:<span>93546</span></li>
                </ul>
            </div>
            <div id="bkjianj">
                <p>欢迎来到<?php echo $rows['name']; ?>帖子</p>
            </div>
        </div>
        <div id="page">
            <div id="pagefy">
                <ul>
                    <li><a href="#">1</a></li>
                    <li><a href="#">2</a></li>
                    <li><a href="#">3</a></li>
                    <li><a href="#">4</a></li>
                    <li><a href="#">5</a></li>
                    <li><a href="#">6</a></li>
                    <li><a href="#">…537</a></li>
                    <li><a href="#">下一页</a></li>
                </ul>
            </div>
            <div id="fatie">

                <button image="../public/home/img/fatie.png"><a href="./requestjs/post.php?id=<?php echo $id; ?>">发帖</a>
                </button>

            </div>
        </div>
        <div id="tiezifl">
            <ul>
                <li class="gaol"><a href="#">全部</a></li>
                <li><a href="">精华</a></li>

            </ul>
        </div>

        <div id="biaotou">
            <ul>
                <li class="tiezibt">排序:<a href="#">最新发帖</a>|<a href="#">最后回复</a></li>
                <li><a href="#">作者</a></li>
                <li><a href="#">回复</a></li>
                <li><a href="#">最后发表</a></li>
            </ul>
        </div>
        <?php
        $link = mysqli_connect("localhost", "root", "") or die("数据连接失败");
        mysqli_set_charset($link, "utf8");
        mysqli_select_db($link, "bbs");
        $sql2 = "select post.*,user.userName from post,user where post.uid =user.id and recycle='0' and tid={$id}  order by top desc,ctime desc";
        $res2 = mysqli_query($link, $sql2);
        if ($res2 && mysqli_num_rows($res2) > 0) {
        while ($rows = mysqli_fetch_assoc($res2)) {
        ?>
        <div id="listks">
            <div class="invitationzt">
                <div class="invitalogo">
                    <?php
                    if ($rows['top'] == '1') {
                        echo "<img src='../public/home/img/zhiding.png'/>";
                        if ($rows['elite'] == '1') {
                            echo "<img src='../public/home/img/jiajing.png'/>";
                        } else {
                            echo "<img src='../public/home/img/tongzhi.png'/>";
                        }
                    } else {
                        if ($rows['elite'] == '1') {
                            echo "<img src='../public/home/img/jiajing.png'/>";
                        } else {
                            echo "<img src='../public/home/img/tongzhi.png'/>";
                        }
                    }
                    ?>

                </div>
                <div class="invitationbt">
                    <a href="details.php?id=<?php echo $id; ?>&pid=<?php echo $rows['id']; ?>&title=<?php echo $rows['title']; ?>&username=<?php echo $rows['userName']; ?>&content=<?php echo $rows['content']; ?>"><?php echo $rows['title']; ?></a>
                </div>
                <div class="custorzt">
                    <img src="../public/home/img/zuanshi.png"/>
                </div>
                <div class="custor">
                    <a href="#"><?php echo $rows['userName']; ?></a>
                </div>
                <div class="reply">
                    <a href="#">27/5961</a>
                </div>
                <div class="last">
                    <a href="#"><?php echo date('Y-m-d', $rows['ctime']); ?></a>
                </div>
            </div>
            <?php
            }
            }
            //	mysqli_free_result($res2);
            ?>
        </div>
        <!--

					<?php
        }
        }
        mysqli_close($link);
        ?>
			<!--列表结束-->
    </div>
    <div id="clear"></div>
    <!--大盒子结束-->

    <!--页面尾开始-->
    <?php require "./foot/footer.php"; ?>
    <!--页面尾结束-->
</body>
</html>